package com.gzyj.jtt808.v2011.enums;

import lombok.Getter;

@Getter
public enum TextFlag {
    紧急(1, "紧急"),
    保留(2, "保留"),
    终端显示器显示(1 << 2, "终端显示器显示"),
    终端TTS播读(1 << 3, "终端 TTS 播读"),
    广告屏显示(1 << 4, "广告屏显示"),
    保留1(1 << 5, "保留"),
    保留2(1 << 6, "保留"),
    保留3(1 << 7, "保留"),
    ;
    private int code;
    private String name;

    TextFlag(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static TextFlag find(int code) {
        for (TextFlag val : TextFlag.values()) {
            if (val.getCode() == code) {
                return val;
            }
        }
        return null;
    }
}